package self.hoy.demo.grainmall.cart.vo;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author hyh
 * @date 2020/8/16
 */
@Data
public class CartItem implements Serializable {
    private static final long serialVersionUID = 3067184873586048873L;
    private Long skuId;
    private Boolean check = true;
    private String title;
    private String image;
    private List<String> skuAttr;
    private BigDecimal price;
    private Integer count;
    private BigDecimal totalPrice;

    public BigDecimal getTotalPrice() {
        return price == null ? BigDecimal.ZERO : price.multiply(new BigDecimal(count));
    }
}
